Global Index
HTML5 JS API Index > SVG Tutorials & Specs

SVGTextContentElement

Extends SVGElement. Implements SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable.

Extended by SVGTextPositioningElement, SVGTextPathElement, SVGTextPositioningElement, SVGTextPathElement

The SVGTextContentElement is inherited by various text-related interfaces, such as SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGAltGlyphElement and SVGTextPathElement.

Properties
const unsigned short
LENGTHADJUST_SPACING = 1
Corresponds to value 'spacing'.
const unsigned short
LENGTHADJUST_SPACINGANDGLYPHS = 2
Corresponds to value 'spacingAndGlyphs'.
const unsigned short
LENGTHADJUST_UNKNOWN = 0
The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVGAnimatedString
className
Corresponds to attribute ‘class’ on the given element.
SVGAnimatedBoolean
externalResourcesRequired
Corresponds to attribute ‘externalResourcesRequired’ on the given element. Note that the SVG DOM defines the attribute ‘externalResourcesRequired’ as being of type SVGAnimatedBoolean, whereas the SVG language definition says that ‘externalResourcesRequired’ is not animated.
SVGAnimatedEnumeration
lengthAdjust
Corresponds to attribute ‘lengthAdjust’ on the given element. The value must be one of the length adjust constants defined on this interface.
SVGStringList
requiredExtensions
Corresponds to attribute ‘requiredExtensions’ on the given element.
SVGStringList
requiredFeatures
Corresponds to attribute ‘requiredFeatures’ on the given element.
CSSStyleDeclaration
style
Corresponds to attribute ‘style’ on the given element. If the user agent does not support styling with CSS, then this attribute must always have the value of null.
SVGStringList
systemLanguage
Corresponds to attribute ‘systemLanguage’ on the given element.
SVGAnimatedLength
textLength
Corresponds to attribute ‘textLength’ on the given element.
DOMString
xmllang
Corresponds to attribute ‘xml:lang’ on the given element. Exceptions on settingDOMException, code NO_MODIFICATION_ALLOWED_ERR Raised on an attempt to change the value of a read only attribute.
DOMString
xmlspace
Corresponds to attribute ‘xml:space’ on the given element. Exceptions on settingDOMException, code NO_MODIFICATION_ALLOWED_ERR Raised on an attempt to change the value of a read only attribute.
Operations
long
getCharNumAtPosition(SVGPoint point)
Returns the index of the character whose corresponding glyph cell bounding box contains the specified point. The calculations assume that all glyphs occupy the full standard glyph cell for the font. If no such character exists, a value of -1 is returned.
float
getComputedTextLength()
The total sum of all of the advance values from rendering all of the characters within this element, including the advance value on the glyphs (horizontal or vertical), the effect of properties ‘kerning’, ‘letter-spacing’ and ‘word-spacing’ and adjustments due to attributes ‘dx’ and ‘dy’ on ‘tspan’ elements.
SVGPoint
getEndPositionOfChar(unsigned long charnum)
Returns the current text position after rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character. This current text position does not take into account the effects of any inter-character adjustments to prepare for the next character, such as properties ‘kerning’, ‘letter-spacing’ and ‘word-spacing’ and adjustments due to attributes ‘x’, ‘y’, ‘dx’ and ‘dy’.
SVGRect
getExtentOfChar(unsigned long charnum)
Returns a tightest rectangle which defines the minimum and maximum X and Y values in the user coordinate system for rendering the glyph(s) that correspond to the specified character. The calculations assume that all glyphs occupy the full standard glyph cell for the font.
long
getNumberOfChars()
Returns the total number of characters available for rendering within the current element, which includes referenced characters from ‘tref’ reference, regardless of whether they will be rendered. Effectively, this is equivalent to the length of the Node::textContent attribute from DOM Level 3 Core ([DOM3], section 1.4), if that attribute also expanded ‘tref’ elements.
CSSValue
getPresentationAttribute(DOMString name)
Returns the base (i.e., static) value of a given presentation attribute as an object of type CSSValue. The returned object is live; changes to the objects represent immediate changes to the objects to which the CSSValue is attached. Note: The getPresentationAttribute method is deprecated, and may be dropped from future versions of the SVG specification.
float
getRotationOfChar(unsigned long charnum)
Returns the rotation value relative to the current user coordinate system used to render the glyph(s) corresponding to the specified character. If multiple glyph(s) are used to render the given character and the glyphs each have different rotations (e.g., due to text-on-a-path), the user agent shall return an average value (e.g., the rotation angle at the midpoint along the path for all glyphs used to render this character).
SVGPoint
getStartPositionOfChar(unsigned long charnum)
Returns the current text position before rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character. The current text position has already taken into account the effects of any inter-character adjustments due to properties ‘kerning’, ‘letter-spacing’ and ‘word-spacing’ and adjustments due to attributes ‘x’, ‘y’, ‘dx’ and ‘dy’.
float
getSubStringLength(unsigned long charnum, unsigned long nchars)
The total sum of all of the advance values from rendering the specified substring of the characters, including the advance value on the glyphs (horizontal or vertical), the effect of properties ‘kerning’, ‘letter-spacing’ and ‘word-spacing’ and adjustments due to attributes ‘dx’ and ‘dy’ on ‘tspan’ elements.
boolean
hasExtension(DOMString extension)
Returns true if the user agent supports the given extension, specified by a URI. ParametersDOMString extension The name of the extension, expressed as a URI. Returns True or false, depending on whether the given extension is supported.
void
selectSubString(unsigned long charnum, unsigned long nchars)
Causes the specified substring to be selected just as if the user selected the substring interactively. Parametersunsigned long charnum The index of the start character which is at the given point, where the first character has an index of 0. unsigned long nchars The number of characters in the substring.